package com.lmx.repoDomain.repository;

import org.springframework.stereotype.Component;

import com.lmx.persistence.service.common.DslJpaService;
import com.lmx.repoDomain.tmodel.Dicttype;
import com.lmx.repoDomain.tmodel.Task;
import com.lmx.repoDomain.tmodel.Typegroup;
import com.lmx.repoDomain.tmodel.Worktime;

import io.katharsis.queryParams.QueryParams;
import io.katharsis.repository.RelationshipRepository;
import io.katharsis.repository.annotations.JsonApiAddRelations;
import io.katharsis.repository.annotations.JsonApiRemoveRelations;
import io.katharsis.repository.annotations.JsonApiSetRelation;

@Component
public class DicttypeToTypegroupRepository extends BaseRelationRepository<Dicttype, Typegroup>{
    
    public DicttypeToTypegroupRepository() {
        this.dslJpaService = new DslJpaService<Dicttype>();
        this.dslJpaService.setEntityClass(Dicttype.class);
    }
    
    @JsonApiSetRelation
    public void setRelation(Dicttype dicttype, Long typeId, String fieldName) {

    }

    @JsonApiAddRelations
    public void addRelations(Dicttype source, Iterable<Long> targetIds, String fieldName) {
    }

    @JsonApiRemoveRelations
    public void removeRelations(Dicttype source, Iterable<Long> targetIds, String fieldName) {
    }


    @Override
    public void setRelations(Dicttype source, Iterable<Long> targetIds, String fieldName) {
        // TODO Auto-generated method stub
        
    }

    @Override
    public Typegroup findOneTarget(Long sourceId, String fieldName, QueryParams queryParams) {
        Dicttype type = (Dicttype)(this.dslJpaService.findById(sourceId));
        return type.getTypegroup();
    }

    @Override
    public Iterable<Typegroup> findManyTargets(Long sourceId, String fieldName, QueryParams queryParams) {
           return null;
    }
}
